<h3 class="content-title">Xem bình luận của bài viết <?php echo $nodeID; ?></h3>
<hr/>
<div class="content-center">
    <ul class="list_node">
        <?php if(sizeof($arrComment['data']) > 0) { ?>
        <li class="title">
            <span class="span-1">STT</span>
            <span class="span-3">Người viết</span>
            <span class="span-10">Nội dung</span>
            <span class="span-3">Ngày Tạo</span>
            <span class="span-2 last">Action</span>
        </li>
        <?php foreach($arrComment['data'] as $index => $node) { ?>
        <li>
            <span class="span-1"><?php echo $index+$offset+1; ?></span>
            <span class="span-3" style="color: #3B5998; text-align: left" title="Email: <?php echo $node['user_email']; ?>"><?php echo $node['user_name']; ?></span>
            <span class="span-10" style="text-align: left"><?php echo $node['content']; ?></span>
            <span class="span-3"><?php echo strftime("%d/%m/%Y - %H:%M", $node['created_on']); ?></span>
            <span class="span-2 last">
                <input type="checkbox" class="verify_box" name="verify_box" value="<?php echo $node['cm_id']; ?>" <?php echo ($node['status'] == 1)?'checked="checked"':''; ?> /> |
                <a href="<?php echo site_url().'/comment/delete/id/'.$node['cm_id']; ?>" onclick="return confirm('Bạn có muốn xóa bình luận này không?');">Xóa</a>
            </span>
        </li>
        <?php } }else{ echo 'Chưa có bình luận nào.';} ?>
    </ul>
    <div class="span-20 last paging">
        <?php
            if(isset($paging))
            {
                echo $this->pagination->create_links();
            }
         ?>
    </div>
</div>
<script type="text/javascript">
    $('input[type=checkbox].verify_box').click(function(){
        var $this = $(this);
        var cm_id = $this.val();
        var status = $this.attr('checked');
        
        if (cm_id < 0)
        {
            return false;
        }
        if(status == true){status = 1;}else{status = 0;}
        
        $.ajax({
            type: 'POST',
            url: config.siteUrl + '/comment/updateCommentStatus',
            data:{cm_id:cm_id, status:status},
            dataType: 'json',
            success: function(result)
            {
                
            }
        });
        
    })
</script>
